// import request from './request'
import request from './axios'

/**
 * 
 * @param {*} params 
 * @returns 
 * 获取售货机列表数据
 */
export const DeviceList = (params) => {
    return request({
        url: '/Device',
        method: 'get',
        params
    })
}

/*
 * 获取单个详情数据
 */
export const DeviceDetali = (id) => {
    return request({
        url: `/Device/${id}`,
        method: 'get'
    })
}
/**
 * 
 * @param {*} params 设备的ID
 * @returns 
 * 门锁列表
 */

export const DeviceLock = (params) => {
    return request({
        url: '/DeviceLock',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 编辑门锁
 */
export const editDeviceLock = (id, params) => {
    return request({
        url: `/DeviceLock/${id}`,
        method: 'put',
        params
    })
}
/**
 * 
 * @param {*} params 设备Id,门锁的id
 * @returns 
 * 售货机的商品管理
 */
export const DeviceGoods = (params) => {
    return request({
        url: '/DeviceGoods',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} id 
 * @param {*} param 
 * @returns 
 * 售货机的商品编辑
 */
export const DeviceGoodsEdit = (id, params) => {
    return request({
        url: `/DeviceGoods/${id}`,
        method: 'put',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 获取城市列表数据
 */
export const GetCity = (params) => {
    return request({
        url: 'index/getCity',
        method: 'get',
        params
    })
}

/**
 * 
 * @param {*} params 
 * @returns 
 * 售货机的添加
 */
export const DeviceAdd = (params) => {
    return request({
        url: 'Device/create',
        method: 'get',
        params
    })
}

/**
 * 编辑售货机数据
 */
export const DeviceEdit = (id, params) => {
    return request({
        url: `/Device/${id}`,
        method: 'put',
        params
    })
}
/**
 * 删除
 */
export const DeviceRemove = (id) => {
    return request({
        url: `/Device/${id}`,
        method: 'delete',
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 补货开门
 */
export const setOpenDoor = (params) => {
    return request({
        url: '/openDoor',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 重启设备
 */
export const rebootDevice = (params) => {
    return request({
        url: '/deviceRestart',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 设置去皮重量
 */
export const setPeel = (params) => {
    return request({
        url: '/extraWeightUpdate',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 设置矫正砝码重量
 */
export const setWeight = (params) => {
    return request({
        url: '/correctWeightSetting',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 发起校准
 */
export const WeightDo = (params) => {
    return request({
        url: '/correctWeightDo',
        method: 'get',
        params
    })
}
/**
 * 
 * @param {*} params 
 * @returns 
 * 重量变化日志
 */
export const WeightLog = (params) => {
    return request({
        url: '/DeviceWeightLog',
        method: 'get',
        params
    })
}